# -*- coding: utf-8 -*-

# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html

import scrapy
from scrapy.loader.processors import TakeFirst


class SinaUserItem(scrapy.Item):
    # 微博用户唯一标识
    user_id = scrapy.Field(output_processor=TakeFirst())
    # 用户昵称
    username = scrapy.Field(output_processor=TakeFirst())
    # 微博数量
    webo_num = scrapy.Field(output_processor=TakeFirst())
    # 关注人数
    follow_num = scrapy.Field(output_processor=TakeFirst())
    # 粉丝人数
    fans_num = scrapy.Field(output_processor=TakeFirst())
    # 性别
    gender = scrapy.Field(output_processor=TakeFirst())
    # 地区
    district = scrapy.Field(output_processor=TakeFirst())
    # 省份
    province = scrapy.Field(output_processor=TakeFirst())
    # 地市
    city = scrapy.Field(output_processor=TakeFirst())
    # 生日
    birthday = scrapy.Field(output_processor=TakeFirst())
    # 简介
    brief_intro = scrapy.Field(output_processor=TakeFirst())
    # 认证
    identify = scrapy.Field(output_processor=TakeFirst())
    # 电脑板
    # internet_url = scrapy.Field(output_processor=TakeFirst())
    # 手机版
    # mobile_url = scrapy.Field(output_processor=TakeFirst())
    # 头像 URL
    head_img = scrapy.Field(output_processor=TakeFirst())
    # 标签
    tag = scrapy.Field()

    # 爬取时间
    crawl_time = scrapy.Field(output_processor=TakeFirst())


class WeiBoContentItem(scrapy.Item):
    # 用户 id
    user_id = scrapy.Field(output_processor=TakeFirst())
    # 微博 id
    weibo_id = scrapy.Field(output_processor=TakeFirst())
    # 权限
    # authority = scrapy.Field(output_processor=TakeFirst())
    # 微博内容
    weibo_content = scrapy.Field(output_processor=TakeFirst())
    # 微博图片
    weibo_images = scrapy.Field()
    # 微博图片保存本地路径
    # images_path = scrapy.Field()
    # 类型（原创/转载）
    weibo_type = scrapy.Field(output_processor=TakeFirst())
    # 发布时间
    post_time = scrapy.Field(output_processor=TakeFirst())
    # 点赞数
    like_count = scrapy.Field(output_processor=TakeFirst())
    # 评论数
    comment_count = scrapy.Field(output_processor=TakeFirst())
    # 转发数
    retweet_count = scrapy.Field(output_processor=TakeFirst())
    # 发布终端
    terminal = scrapy.Field(output_processor=TakeFirst())


if __name__ == '__main__':
    item = WeiBoContentItem()
    print(item.get('weibo_images'))
